/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package memory;


import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

/**
 *
 * @author Oscar
 */
public class Partida extends ArrayList<Carta>{
    
    
    private Dificultad d;
    private Tema t;

    public Partida(Dificultad dificultad, Tema tema) {
        this.d = dificultad;
        this.t = tema;
        
        for(int i = 0,j = 0;i < d.getNumCartas();i++,i++,j++){
            
            if(j == t.getRutas().length){
                
                j = 0;
            }
            
            this.add(new Carta(tema.getRutas()[j]));
            this.add(new Carta(tema.getRutas()[j]));
        }
    }
    
        
    public Carta[] devuelvecartasAleatorias(){
        
        Collections.shuffle(this);
        return this.toArray(new Carta[this.size()]);
    }


    public Dificultad getD() {
        return d;
    }

    public Tema getT() {
        return t;
    }    
    
    
}
